package sctu.edu.java.year2016.team08.lisonghong.day20160616.chapter17_3;

import java.util.Scanner;

/**
 * Created by 松红 on 2016/6/16.
 */
public class SignUp {
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        System.out.println("请输入5位字母账号：");
        String username=input.nextLine();
        System.out.println("请输入6位整型密码：");
        String password=input.nextLine();
        boolean u1=username.matches("\\p{Alpha}\\p{Alpha}\\p{Alpha}\\p{ASCII}\\p{Alpha}");
        boolean p1=password.matches("\\d\\d\\d\\d\\d\\d");
//        String username1=(\\p{Alpha});
//        String password1;
        if(!u1){
            System.out.println("账号格式不对，注册失败！");
        }else if(!p1){
            System.out.println("密码格式不对，注册失败！");
        }else{
            System.out.println("注册成功！");
        }

    }
}
